package ${package.Entity};

<#list table.importPackages as pkg>
    import ${pkg};
</#list>
<#if swagger>
    import io.swagger.v3.oas.annotations.media.Schema;
</#if>
<#if entityLombokModel>
    import lombok.Data;
    import lombok.EqualsAndHashCode;
    import lombok.experimental.Accessors;
</#if>
<#if table.convert>
    import com.baomidou.mybatisplus.annotation.TableName;
</#if>
<#if springdoc>
    import io.swagger.v3.oas.annotations.media.Schema;
</#if>
<#if fieldTypeMap??>
    <#if fieldTypeMap?keys?seq_contains("LocalDateTime")>
        import java.time.LocalDateTime;
    </#if>
    <#if fieldTypeMap?keys?seq_contains("LocalDate")>
        import java.time.LocalDate;
    </#if>
</#if>

/**
* <p>
    * ${table.comment!}
    * </p>
*
* @author ${author}
* @since ${date}
*/
<#if table.convert>
    @TableName("${table.name}")
</#if>
<#if entityLombokModel>
    @Data
</#if>
public class ${entity} <#if superEntityClass??>extends ${superEntityClass}<#if activeRecord><${entity}></#if></#if> <#if activeRecord>extends Model<${entity}></#if> {

<#-- ----------  BEGIN 字段循环遍历  ---------->
<#list table.fields as field>
    <#if field.keyFlag>
        <#assign keyPropertyName="${field.propertyName}"/>
    </#if>

    <#if field.comment!?length gt 0>
        <#if swagger>
            <#if field.keyFlag>
                @Schema(description = "${field.comment}", required = true)
            <#else>
                @Schema(description = "${field.comment}", required = false)
            </#if>
        <#else>
            /** ${field.comment} */
        </#if>
    </#if>
    <#if field.keyFlag>
    <#-- 主键 -->
        @TableId(value = "${field.annotationColumnName}", type = IdType.${idType})
    <#elseif field.fill??>
    <#-- 字段填充 -->
        @TableField(value = "${field.annotationColumnName}", fill = FieldFill.${field.fill})
    <#elseif field.convert>
        @TableField("${field.annotationColumnName}")
    </#if>
<#-- 乐观锁字段 -->
    <#if (versionFieldName!"") == field.name>
        @Version
    </#if>
<#-- 逻辑删除字段 -->
    <#if (logicDeleteFieldName!"") == field.name>
        @TableLogic
    </#if>
    private ${field.propertyType} ${field.propertyName};
</#list>
<#------------  END 字段循环遍历  ---------->

<#-- ----------  BEGIN 构造函数  ---------->
<#if entityColumnConstant>
    public ${entity}() {}
</#if>
<#------------  END 构造函数  ---------->
}